import axios from './http';
import {
  stringify
} from 'qs';

export default {
  dossierList(params) {
    const url = '/dossier/list';
    return new Promise((resolve, reject) => {
      axios.get(`${url}?${stringify(params)}`).then(data => {
        resolve(data)
      })
    });
  },
  addPatient(params) {
    const url = '/dossier/add';
    return new Promise((resolve, reject) => {
      axios.post(url, params).then(data => {
        resolve(data)
      })
    });
  },
  SelectPatient(params) {
    const url = '/dossier/select';
    return new Promise((resolve, reject) => {
      axios.get(`${url}?${stringify(params)}`).then(data => {
        resolve(data)
      })
    });
  },
  updatePatient(params) {
    const url = '/dossier/update';
    return new Promise((resolve, reject) => {
      axios.post(url, params).then(data => {
        resolve(data)
      })
    });
  },

  prescribe(params) {
    const url = '/prescribe';
    return new Promise((resolve, reject) => {
      axios.post(url, params).then(data => {
        resolve(data)
      })
    });
  },
};
